package com.wude.guild.adapter;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.wude.bean.StartFuBean;
import com.wude.guild.holder.GameDetQufuHolder;

import java.util.ArrayList;
import java.util.List;

/**
 * 游戏详情区服Adapter
 * Created by Administrator on 2017/3/13.
 */

public class GameDetListQufuAdapter extends BaseAdapter {
    private final Activity con;
    public List<StartFuBean> list = new ArrayList<StartFuBean>();

    public GameDetListQufuAdapter(Activity activity){
        this.con = activity;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        GameDetQufuHolder holder = null;
        if (convertView == null) {
            holder = new GameDetQufuHolder();
        } else {
            holder = (GameDetQufuHolder) convertView.getTag();
        }
        StartFuBean startFuBean = list.get(position);
        holder.setData(startFuBean,position,con);
        return holder.getContentView();
    }

    public void setList(List<StartFuBean> b){
        this.list=b;
        notifyDataSetChanged();
    }

    public List<StartFuBean> getList(){
        return list;
    }
}
